package com.xuecheng.content.model.dto;

import com.xuecheng.base.exception.ValidationGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * @author luhao
 * @ClassName AddCourseDto.java
 * @Description 添加课程信息请求Dto
 * @createTime 2023/5/23
 */
@Data
@ApiModel(value="AddCourseDto", description="新增课程基本信息")
public class AddCourseDto {

 @NotEmpty(message = "添加课程名称不能为空",groups = {ValidationGroups.Insert.class})
 @NotEmpty(message = "修改课程名称不能为空",groups = {ValidationGroups.Update.class})
 @Size(max = 50,min = 2,message = "课程名称应在2~50字符之间")
 @ApiModelProperty(value = "课程名称", required = true)
 private String name;

 @NotEmpty(message = "适用人群不能为空")
 @Size(message = "适用人群内容应在10~500个字符之间",min = 10,max = 500)
 @ApiModelProperty(value = "适用人群", required = true)
 private String users;

 @ApiModelProperty(value = "课程标签")
 private String tags;

 @NotEmpty(message = "课程分类不能为空")
 @ApiModelProperty(value = "大分类", required = true)
 private String mt;

 @NotEmpty(message = "课程分类不能为空")
 @ApiModelProperty(value = "小分类", required = true)
 private String st;

 @NotEmpty(message = "课程等级不能为空")
 @ApiModelProperty(value = "课程等级", required = true)
 private String grade;

 @ApiModelProperty(value = "教学模式（普通，录播，直播等）", required = true)
 private String teachmode;

 @ApiModelProperty(value = "课程介绍")
 private String description;

 @ApiModelProperty(value = "课程图片", required = true)
 private String pic;

 @NotEmpty(message = "收费规则不能为空")
 @ApiModelProperty(value = "收费规则，对应数据字典", required = true)
 private String charge;

 @ApiModelProperty(value = "价格")
 @Digits(integer = 12, fraction = 2,message = "金额最高整数位为12位，小数为2位")
 @Min(value = 0L,message = "价格不能低于0元")
 private Float price;
 @ApiModelProperty(value = "原价")
 @Digits(integer = 12, fraction = 2,message = "金额最高整数位为12位，小数为2位")
 @Min(value = 0L,message = "价格不能低于0元")
 private Float originalPrice;


 @ApiModelProperty(value = "qq")
 private String qq;

 @ApiModelProperty(value = "微信")
 private String wechat;
 @ApiModelProperty(value = "电话")
 private String phone;

 @ApiModelProperty(value = "有效期")
 private Integer validDays;

 @ApiModelProperty(value = "机构id")
 @NotNull(message = "修改机构id不能为空",groups = ValidationGroups.Update.class)
 private Long companyId;
}
